﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Kovan.BLL.UserCenter;
using Kovan.BLL.Common;

namespace Kovan.UI.Controllers
{
    public class AccountController : Controller
    {
        //
        // GET: /Account/

        public ActionResult Index(string loginName, string pwd)
        {
            if (!string.IsNullOrWhiteSpace(loginName) && !string.IsNullOrWhiteSpace(pwd))
            {
                if (BUserLogin.GetInstances().Login(loginName, pwd))
                {
                    //用户信息
                    WebConfig.CurrentUser = BUserLogin.GetUser();
                    Response.Redirect(Url.Content("~/Manage"));
                }
            }
            return View();
        }

        public ActionResult LoginOff()
        {
            BUserLogin.GetInstances().LoginOff();
            return View("Index");
        }

    }
}
